package org.xinjiang.data.migration.flush.enums;

import lombok.Getter;

/**
 * 专业
 */
@Getter
public enum SpecialityEnum {
    LAW("820", "法学", "54", null),

    LINGUISTICS("740", "语言学", "47", null),

    INDUSTRIAL_AND_CIVIL_ARCHITECTURE("工民建筑", "工民建筑", "37", null),

    CHEMISTRY("150", "化学", "33", null),

    PHYSICS("140", "物理学", "4", null),

    BIOLOGY("180", "生物学", "8", null),

    ECONOMICS("790", "经济学", "52", null),//没有

    SPORTS_SCIENCE("890", "体育科学", "61", null),

    COMPUTER_SCIENCE_AND_TECHNOLOGY("520", "计算机科学技术", "32", null),

    INFANTRY_COMMAND("步兵指挥", "步兵指挥", "0", null),

    MECHANICAL_ENGINEERING("460", "机械工程", "27", null),

    UNKNOWN("UNKNOWN", "其他", "0", null);

    /* 数据来源code
     */
    private String sourceCode;

    /**
     * 数据来源名成
     */
    private String sourceName;


    private String targetCode;

    private Integer id;

    SpecialityEnum(String sourceCode, String sourceName, String targetCode, Integer id) {
        this.sourceCode = sourceCode;
        this.sourceName = sourceName;
        this.targetCode = targetCode;
        this.id = id;
    }

    public static SpecialityEnum toCode(String sourceCode) {
        for (SpecialityEnum value : SpecialityEnum.values()) {
            if (value.sourceCode.equals(sourceCode)) {
                return value;
            }
        }
        return UNKNOWN;
    }
}
